#define  _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>

typedef int ElemType;

typedef struct likelist
{
	ElemType data;
	struct likelist* next;
}linklist,* LinkList;

typedef struct queue
{
	linklist* front, *rear;
}Queue;


void IniteQueue(Queue &Q)
{
	Q.front = Q.rear = (LinkList)malloc(sizeof(linklist));
	Q.rear->next = Q.front;
}

void PushQueue(Queue& Q, ElemType x)
{
	LinkList ppnew;
	if (Q.front == Q.rear->next)
	{
		ppnew= (LinkList)malloc(sizeof(linklist));
		ppnew->data = x;
		ppnew->next = Q.rear->next;
		Q.rear->next = ppnew;
		Q.rear = ppnew;

	}
	else
	{
		ppnew = Q.rear->next;
		ppnew->data = x;
	}

}
int main()
{
	Queue Q;
	IniteQueue(Q);


	PushQueue(Q, 1);
	PushQueue(Q, 2);
	PushQueue(Q,3);

	return 0;
}